package com.youfang.sixthmedia.message;

import java.util.LinkedList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

import com.youfang.sixthmedia.message.model.Building;
import com.youfang.sixthmedia.message.model.DetailBuilding;
import com.youfang.sixthmedia.net.Response;

public class GetNearHouseResponse extends Response {

	List<Building> dataList = new LinkedList<Building>();

	@Override
	protected void decodeBody(JSONObject bodyJSON) throws Exception {

		JSONArray arr = bodyJSON.getJSONArray("data");
		for (int i = 0; i < arr.length(); i++) {
			JSONObject o = arr.getJSONObject(i);

			DetailBuilding detail = new DetailBuilding();
			GethousedetailResponse.parse(detail, o);
			dataList.add(detail);

		}

	}

	public List<Building> getDataList() {
		return dataList;
	}

	public void setDataList(List<Building> dataList) {
		this.dataList = dataList;
	}

}
